using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._GeodatabaseAdministration
{
    /// <summary>
    /// <para>Create Database Sequence</para>
    /// <para>Creates a database sequence in a geodatabase. You can use the sequences in custom applications that access the geodatabase.</para>
    /// <para>在地理数据库中创建数据库序列。您可以在访问地理数据库的自定义应用程序中使用序列。</para>
    /// </summary>    
    [DisplayName("Create Database Sequence")]
    public class CreateDatabaseSequence : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateDatabaseSequence()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para><xdoc>
        ///   <para>The database connection file (.sde) to connect to the enterprise geodatabase in which you want to create a sequence or the path to the file geodatabase (including the file geodatabase name).</para>
        ///   <para>For database connections, the user specified in the database connection will be the owner of the sequence and, therefore, must have the following permissions in the database:
        ///   <bulletList>
        ///     <bullet_item>Db2—CREATEIN privilege on their schema  </bullet_item><para/>
        ///     <bullet_item>Oracle—CREATE SEQUENCE system privilege  </bullet_item><para/>
        ///     <bullet_item>PostgreSQL—Authority on their schema  </bullet_item><para/>
        ///     <bullet_item>SAP HANA—Must be a standard user  </bullet_item><para/>
        ///     <bullet_item>SQL Server—CREATE SEQUENCE privilege and ALTER OR CONTROL permission on their schema  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于连接到要在其中创建序列的企业级地理数据库的数据库连接文件 （.sde） 或文件地理数据库的路径（包括文件地理数据库名称）。</para>
        /// <para>对于数据库连接，在数据库连接中指定的用户将是序列的所有者，因此必须在数据库中具有以下权限：
        ///   <bulletList>
        ///     <bullet_item>Db2 - 对其模式的 CREATEIN 特权</bullet_item><para/>
        ///     <bullet_item>Oracle — CREATE SEQUENCE 系统权限</bullet_item><para/>
        ///     <bullet_item>PostgreSQL - 架构的权威</bullet_item><para/>
        ///     <bullet_item>SAP HANA - 必须是标准用户</bullet_item><para/>
        ///     <bullet_item>SQL Server - 对其架构的 CREATE SEQUENCE 权限和 ALTER OR CONTROL 权限</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_seq_name">
        /// <para>Sequence Name</para>
        /// <para>The name you want to assign to the database sequence. For enterprise geodatabases, the name must meet sequence name requirements for the database platform you're using and must be unique in the database. For file geodatabases, the name must be unique to the file geodatabase. It is important that you remember this name, as it is the name you use in your custom applications and expressions to invoke the sequence.</para>
        /// <para>要分配给数据库序列的名称。对于企业级地理数据库，该名称必须满足所使用的数据库平台的序列名称要求，并且在数据库中必须是唯一的。对于文件地理数据库，文件地理数据库的名称必须是唯一的。请务必记住此名称，因为它是您在自定义应用程序和表达式中用于调用序列的名称。</para>
        /// </param>
        public CreateDatabaseSequence(object _in_workspace, object _seq_name)
        {
            this._in_workspace = _in_workspace;
            this._seq_name = _seq_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Database Sequence";

        public override string CallName => "management.CreateDatabaseSequence";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_workspace, _seq_name, _seq_start_id, _seq_inc_value, _out_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para><xdoc>
        ///   <para>The database connection file (.sde) to connect to the enterprise geodatabase in which you want to create a sequence or the path to the file geodatabase (including the file geodatabase name).</para>
        ///   <para>For database connections, the user specified in the database connection will be the owner of the sequence and, therefore, must have the following permissions in the database:
        ///   <bulletList>
        ///     <bullet_item>Db2—CREATEIN privilege on their schema  </bullet_item><para/>
        ///     <bullet_item>Oracle—CREATE SEQUENCE system privilege  </bullet_item><para/>
        ///     <bullet_item>PostgreSQL—Authority on their schema  </bullet_item><para/>
        ///     <bullet_item>SAP HANA—Must be a standard user  </bullet_item><para/>
        ///     <bullet_item>SQL Server—CREATE SEQUENCE privilege and ALTER OR CONTROL permission on their schema  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于连接到要在其中创建序列的企业级地理数据库的数据库连接文件 （.sde） 或文件地理数据库的路径（包括文件地理数据库名称）。</para>
        /// <para>对于数据库连接，在数据库连接中指定的用户将是序列的所有者，因此必须在数据库中具有以下权限：
        ///   <bulletList>
        ///     <bullet_item>Db2 - 对其模式的 CREATEIN 特权</bullet_item><para/>
        ///     <bullet_item>Oracle — CREATE SEQUENCE 系统权限</bullet_item><para/>
        ///     <bullet_item>PostgreSQL - 架构的权威</bullet_item><para/>
        ///     <bullet_item>SAP HANA - 必须是标准用户</bullet_item><para/>
        ///     <bullet_item>SQL Server - 对其架构的 CREATE SEQUENCE 权限和 ALTER OR CONTROL 权限</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Sequence Name</para>
        /// <para>The name you want to assign to the database sequence. For enterprise geodatabases, the name must meet sequence name requirements for the database platform you're using and must be unique in the database. For file geodatabases, the name must be unique to the file geodatabase. It is important that you remember this name, as it is the name you use in your custom applications and expressions to invoke the sequence.</para>
        /// <para>要分配给数据库序列的名称。对于企业级地理数据库，该名称必须满足所使用的数据库平台的序列名称要求，并且在数据库中必须是唯一的。对于文件地理数据库，文件地理数据库的名称必须是唯一的。请务必记住此名称，因为它是您在自定义应用程序和表达式中用于调用序列的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sequence Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _seq_name { get; set; }


        /// <summary>
        /// <para>Sequence Start ID</para>
        /// <para>The starting number of the sequence. If you do not provide a starting number, the sequence starts with 1. If you do provide a starting number, it must be greater than 0.</para>
        /// <para>序列的起始编号。如果未提供起始编号，则序列以 1 开头。如果提供起始编号，则该编号必须大于 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sequence Start ID")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _seq_start_id { get; set; } = null;


        /// <summary>
        /// <para>Sequence Increment Value</para>
        /// <para>Describes how the sequence numbers will increment. For example, if the sequence starts at 10 and the increment value is 5, the next value in the sequence is 15, and the next value after that is 20. If you do not specify an increment value, sequence values will increment by 1.</para>
        /// <para>描述序列号将如何递增。例如，如果序列从 10 开始，增量值为 5，则序列中的下一个值为 15，之后的下一个值为 20。如果未指定增量值，则序列值将递增 1。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sequence Increment Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _seq_inc_value { get; set; } = null;


        /// <summary>
        /// <para>Created sequence in geodatabase</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Created sequence in geodatabase")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public CreateDatabaseSequence SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}